<?php
/**
 * Created by PhpStorm.
 * User: dev
 * Date: 5/9/14
 * Time: 3:18 PM
 */
class Post extends Eloquent {

    public static $table = 'post';
    public static $key = 'id';



    function __construct(){
        parent::__construct();
    }

    public function comments()
    {
        return $this->has_many('Comments');
    }

    public static function total(){
        return Post::count();
    }

    public function user()
    {
        return $this->belongs_to('Users');
    }

}